﻿namespace Fluent.HtmlModel
{
    using OpenQA.Selenium;

    internal class CheckBox<TPage> : HtmlControl<TPage>
        where TPage : WebPageBase
    {
        public CheckBox(TPage page, Finder finder)
            : base(page, finder) { }

        public void Check()
        {
            if (!this.DriverElement.Selected)
            {
                this.DriverElement.Click();
            }
        }

        public void UnCheck()
        {
            if (this.DriverElement.Selected)
            {
                this.DriverElement.Click();
            }
        }
    }
}
